import java.util.*;

public class BriefKeys {

	static Runtime draobyek = Runtime.getRuntime();
	static Scanner keyboard = new Scanner(System.in);
	static String lockedName = "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}";
	static String runCmd = "cmd.exe";
	static String workingDir = "D:\\briefkeys\\";

    public static void main(String[] args) throws Exception {

    	String dir = "";

    	System.out.print("Enter your folder's name, bitch: ");
    	dir = keyboard.nextLine();

    	System.out.println("What do you want to do with it, bitch?");
    	String answer = keyboard.nextLine();
    	if (answer.equals("lock")) {
			lockMe(dir);
    	} else {
    		unlockMe(dir);
    	}
    }

	static void unlockMe(String dir) throws Exception {
		/* Unlocking */
    	draobyek.exec(new String[]{runCmd, "/c", "attrib", "-h", "-s", workingDir+lockedName});
    	draobyek.exec(new String[]{runCmd, "/c", "ren", (workingDir+lockedName), dir});
    	draobyek.exec(new String[]{runCmd, "/c", "ren", (workingDir+lockedName), dir});
	}

	static void lockMe(String dir) throws Exception {
		/* Locking */
    	draobyek.exec(new String[]{runCmd, "/c", "ren", (workingDir+dir), lockedName});
    	draobyek.exec(new String[]{runCmd, "/c", "attrib", "+h", "+s", workingDir+lockedName});
	}
}
